<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>模糊搜索</title>
    <style>

    </style>
  <script src="../../static/js/vue.js"></script>
</head>
<body>


<div id="box">
  <ul>
    <input type="text" v-model="my_text">
    <li v-for="item in my_search()">
      {{ item }}
    </li>
  </ul>
</div>

<script>
  new Vue
  ({
    el: "#box",
    data:
            {
              my_text: "",
              data_list: ["aaa", "aab", "aac", 'abb', 'abc', 'abc']
            },
    methods:
            {
              my_search()
              {
                return this.data_list.filter(item=>item.includes(this.my_text))
              }
            }
  })
</script>
</body>
</html>